package com.it.mytest;

import org.eclipse.californium.core.server.resources.CoapExchange;

public class TemperatureResource extends AbstractResource{

    public TemperatureResource () {
        //super (ResourceSpecs.House.Sensors.Temperature);
        super("temperature");
        getAttributes ().setTitle ("Temperature resource !");
    }

    @Override
    public void handleGET (CoapExchange exchange) {
        String response = "The temperature";
        if (getWildcards() != null) {
            response += " of the " + getWildcards().get (0) + " on the " + getWildcards().get (1);
        }
        response += " is : 25 degree C";

        exchange.respond (response);
    }
}
